import request from '@/utils/request'

/**
 * @description: 获取语法列表
 * @param {*} params
 */
export function getGrammarList(params) {
  return request({
    url: '/system/grammar/list',
    params
  })
}

/**
 * @description: 保存语法信息
 * @param {*} data
 */
export function saveGrammarMessage(data) {
  return request({
    url: '/system/grammar/save',
    method: 'post',
    data
  })
}

/**
 * @description: 验证语法ID是否重复
 * @param {*} params
 */
export function isCanUseGrammarID(params) {
  return request({
    url: '/system/validate/grammarid',
    params
  })
}

/**
 * @description: 验证语法版本号是否重复
 * @param {*} params
 */
export function isCanUseVersion(params) {
  return request({
    url: '/system/validate/version',
    params
  })
}

/**
 * @description: 获取语法详情
 * @param {*} params
 */
export function getGrammarDetail(params) {
  return request({
    url: '/system/grammar/detail',
    params
  })
}

/**
 * @description: 获取语法的历史记录
 * @param {*} params
 */
export function getGrammarHistory(params) {
  return request({
    url: 'system/grammer/module/history',
    params
  })
}
